import 'package:dio/dio.dart';

class HKHttp {
  static final Dio dio = Dio();

  static void get(String url, {Map<String, dynamic> params}) {}

  static void post(String url, {Map<String, dynamic> params}) {}

  static Future frequest(String url,{
    String method = 'get',
    Map<String,String>headers,
    Map<String,dynamic>queryParameters,
    CancelToken cancelToken,
    int timeOut
  }){

    final options = Options(method: method,receiveTimeout: timeOut,headers: headers);

    return dio.request(url,options: options,queryParameters: queryParameters,cancelToken:cancelToken);
  }
}

Future<Response> fget(
  url,{
    String method = 'get',
      Map<String,String>headers,
      Map<String,dynamic>queryParameters,
      CancelToken cancelToken,
      int timeOut
  }){
  final dio = Dio();
  final options = Options(method: method,receiveTimeout: timeOut,headers: headers);

  return dio.get(url,options: options,queryParameters: queryParameters,cancelToken:cancelToken);
}